/*!
 * \file main.cpp
 */
#include <stdio.h>
#include "quadruple.h"
#include "scope.h"

extern FILE* yyin;
extern int yydebug;
int yyparse();

int main(int argc,char **argv)
{
  ++argv, --argc;  /* skip over program name */
  if ( argc > 0 )
    yyin = fopen( argv[0], "r" );
  else
    yyin = stdin;

//  yydebug=1;

  int rc=1;
  try
  {
    rc=yyparse();
  }
  catch(const char* m)
  {
    printf("parse error: %s\n",m);
  }
    
  printf("quadruples:\n");
  quadrupleDump();
  printf("\nframe content:\n");
  getFrame().dump();
  printf("\n\n");
  return rc;
}
